import db from '../dbserver'
import Sequelize from 'sequelize'

const Maintenance_record = db.define('maintenance_record', {
    id: {
        type: Sequelize.INTEGER(11),
        allowNull: false,
        primaryKey: true,
        autoIncrement: true
    },
    state: {
        type: Sequelize.STRING(10),
        allowNull: true
    },
    submission_time: {
        type: Sequelize.DATE,
        allowNull: true
    },
    processing_time: {
        type: Sequelize.DATE,
        allowNull: true
    },
    completion_time: {
        type: Sequelize.DATE,
        allowNull: true
    },
    company: {
        type: Sequelize.STRING(50),
        allowNull: true
    },
    department: {
        type: Sequelize.STRING(50),
        allowNull: true
    },
    user_name: {
        type: Sequelize.STRING(20),
        allowNull: true
    },
    contacts: {
        type: Sequelize.STRING(50),
        allowNull: true
    },
    contact_number: {
        type: Sequelize.STRING(50),
        allowNull: true
    },
    device_id: {
        type: Sequelize.INTEGER(11),
        allowNull: true
    },
    reason: {
        type: Sequelize.STRING(255),
        allowNull: true
    },
    cost: {
        type: Sequelize.DECIMAL,
        allowNull: true
    },
    service_provider_name: {
        type: Sequelize.STRING(50),
        allowNull: true
    }
}, {
    timestamps: false,
    freezeTableName: true,
    tableName: 'maintenance_record'
});

export default Maintenance_record
